Skip to content

Add workspace/textDocumentContent request (#3852) - #3855

Merged
datho7561 merged 2 commits into
eclipse-jdtls:mainfrom
MeherSru:fix-3852-workspace-text-document-content
Aug 5, 2026
Merged

Add workspace/textDocumentContent request (#3852)#3855
datho7561 merged 2 commits into
eclipse-jdtls:mainfrom
MeherSru:fix-3852-workspace-text-document-content

Conversation

@MeherSru

Copy link
Copy Markdown
Contributor

This adds support for the new workspace/textDocumentContent request from LSP 3.18. It answers the same way the old custom java/classFileContents request does, using the same content-fetching code, so editors can now get decompiled/virtual file content without needing extra custom glue code. The old java/classFileContents request still works exactly as before. Fixes #3852.

@MeherSru
MeherSru marked this pull request as ready for review July 22, 2026 14:25
@datho7561

Copy link
Copy Markdown
Contributor

I tried to use it with vscode-java and realised we need to make quite a few changes to vscode-java to try this out. In order to use features from 3.18 there, we'll need to upgrade to vscode-languageclient v10, and in order to do that, we'll need to modernize many aspects of the project. I'll open some issues on that repo for the steps we need to take.

@datho7561 datho7561 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this is working by trying it out in vscode-java.

Here's what I needed to do to get it to work on vscode-java:

  1. Update vscode-languageclient to 10.0.0 (10.1.0 wasn't working)
  2. Call this.registerProposedFeatures(); in the TracingLanguageServer client (this is a workaround that 10.1.0 was supposed to fix, but the fix wasn't working properly for me)
  3. Update tsconfig.base.json to target es2020 and use the nodenext module system
  4. The above changes caused some compiler errors due to API changes so I addressed those
  5. Remove the jdt:// content provider
  6. Remove the code that changes jdt:// links to a command invocation (extension.ts#288)

Do you want me to make a branch with these changes? Do you want to try and do that?

@MeherSru
MeherSru marked this pull request as draft August 4, 2026 09:59
@MeherSru

MeherSru commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Confirmed this is working by trying it out in vscode-java.

Here's what I needed to do to get it to work on vscode-java:

  1. Update vscode-languageclient to 10.0.0 (10.1.0 wasn't working)
  2. Call this.registerProposedFeatures(); in the TracingLanguageServer client (this is a workaround that 10.1.0 was supposed to fix, but the fix wasn't working properly for me)
  3. Update tsconfig.base.json to target es2020 and use the nodenext module system
  4. The above changes caused some compiler errors due to API changes so I addressed those
  5. Remove the jdt:// content provider
  6. Remove the code that changes jdt:// links to a command invocation (extension.ts#288)

Do you want me to make a branch with these changes? Do you want to try and do that?

Thanks for building this out! I'll try your branch and test it.

@MeherSru
MeherSru marked this pull request as ready for review August 4, 2026 10:31

@datho7561 datho7561 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried in out in my branch and it was working properly. Also confirmed that it doesn't crash in vscode-java without my changes (it won't be used until the vscode-java knows to use it though).

@datho7561
datho7561 merged commit 9d6941a into eclipse-jdtls:main Aug 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace the custom java/classFileContents request by the standard workspace/textDocumentContent request from 3.18

2 participants